/**fscanf sscanf*/
#include<errno.h>
#include<stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
	char buf1[20]={0};
	scanf("%s",buf1);
	printf("buf1=%s\n",buf1);
	fscanf(stdin,"%s",buf1);
	printf("buf1=%s\n",buf1);

	int a,b, c;
	FILE* f=NULL;
	f=fopen("test.txt","r");
	if(NULL==f){
		perror("fopen error");
		return 1;
	}
	fscanf(f,"%d %d %d",&a,&b,&c);
	printf("%d %d %d",a,b,c);
	fclose(f);


	char *str="5450 hello";
	char buf[10],buf2[10],buf3[10];
	int d;
	sscanf(str,"%d %s",&d,buf);
	printf("d=%d\n",d);
	printf("buf=%s\n",buf);
	sscanf("dont do this,please","%s %s %s",buf,buf2,buf3);
	printf("buf=%s,buf2=%s,buf3=%s\n",buf,buf2,buf3);
	return 0;
}
